﻿using gt.UserInfo.DomainModels.Entity;
using gt.UserInfo.DomainModels.Respository;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace gt.UserInfo.Intrastructures.EF
{
    public class UserRepository : EFRepositoryBase<UserEntity, int>, IUserRepository
    {
        public UserRepository(DbContext dbContext)
            : base(dbContext)
        {
        }

        public async Task<UserEntity> GetUserAsync(string name, string password)
        {
            return await _dbSet.FirstOrDefaultAsync(x => x.Name == name
                   && x.Password == password);
        }
    }
}
